import request from '@/utils/request'

export const createPost = data => {
  return request({
    method: 'POST',
    url: '/article',
    data
  })
}

export const getPostList = (data) => {
  return request({
    method: 'GET',
    url: '/article',
    params: data
  })
}

export const deleteArticle = ( articleId ) => {
  return request({
    method: 'DELETE',
    url: '/article/' + articleId,
  })
}

export const updatePost = (articleId,data) => {
  return request({
    method: 'PUT',
    url: '/article/'+ articleId,
    data
  })
}


export const sendPhoto = data => {
  return request({
    method: 'POST',
    url: '/article/photo',
    data
  })
}


export const articlePhoto = data => {
  return request({
    method: 'POST',
    url: '/article/articlePhoto',
    data
  })
}
